package com.project.nimsen.weixin.bean;

import org.apache.commons.lang3.StringUtils;
import org.dom4j.Element;

/**
 * 接收地理位置消息类
 * */
public class LocationRMsg extends BaseRMsg {
	private String locationx;//地理位置维度
	private String locationy;//地理位置经度
	private String scale;//地图缩放大小
	private String label;//地理位置信息
	public String getLocationx() {
		return locationx;
	}
	public void setLocationx(String locationx) {
		this.locationx = locationx;
	}
	public String getLocationy() {
		return locationy;
	}
	public void setLocationy(String locationy) {
		this.locationy = locationy;
	}
	public String getScale() {
		return scale;
	}
	public void setScale(String scale) {
		this.scale = scale;
	}
	public String getLabel() {
		return label;
	}
	public void setLabel(String label) {
		this.label = label;
	}

	protected String info() {
		StringBuffer info = new StringBuffer(super.info());
		info.append("<Location_X>").append(this.getLocationx()).append("</Location_X>");
		info.append("<Location_Y>").append(this.getLocationy()).append("</Location_Y>");
		info.append("<Scale>").append(this.getScale()).append("</Scale>");
		info.append("<Label><![CDATA[").append(this.getLabel()).append("]]></Label>");
		return info.toString();
	}
	protected void fullchildProperty(Element root) {
		super.fullchildProperty(root);
		String str_location_x = root.elementText("Location_X");
		if(StringUtils.isNotBlank(str_location_x))
			this.setLocationx(str_location_x);
		String str_location_y = root.elementText("Location_Y");
		if(StringUtils.isNotBlank(str_location_y))
			this.setLocationy(str_location_y);
		String str_scale = root.elementText("Scale");
		if(StringUtils.isNotBlank(str_scale))
			this.setScale(str_scale);
		String str_label = root.elementText("Label");
		if(StringUtils.isNotBlank(str_label))
			this.setLabel(str_label);
	}
}
